
PROJ_ROOT_PATH = /home/ted/workspace/hargic/Hargic
include $(PROJ_ROOT_PATH)/board.mk

ifeq ($(BOARD), ORANGEPIZERO)
BUILD_DIR = /home/ted/workspace/armbian/build/cache
KERN_DIR = $(BUILD_DIR)/sources/linux-sun8i/sun8i
CROSS = ARCH=arm CROSS_COMPILE=$(BUILD_DIR)/toolchains/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-
endif

ifeq ($(BOARD), RASPBERRYPI)
KVERS = $(shell uname -r)
KERN_DIR = /lib/modules/$(KVERS)/build
CROSS =
endif

MODU_DIR =

# Kernel modules
obj-m += beep2_drv.o

# Specify flags for the module compilation.
EXTRA_CFLAGS = -g -O1


build: kernel_modules

kernel_modules:
	make $(CROSS) -C $(KERN_DIR) M=$(CURDIR) modules

clean:
	make $(CROSS) -C $(KERN_DIR) M=$(CURDIR) clean
